package test.factories;

import dominio.Cost;

import java.util.Random;

/**
 * Created by Rafael Simon Garcia on 11/17/13.
 */

public class CostFactory {
    public static Cost Create(int id, int ownerId, int maxValue){
        Random rand = new Random();
        Cost c;
        // if the cost is to the same type of task that owns it then the switching cost is 0
        // otherwise return a cost with a random maxValue
        c = (ownerId == id) ? new Cost(id, 0) : new Cost(id, rand.nextInt(maxValue));
        return c;
    }
}
